# conding:utf-8

import urllib
# import urllib2
import re
def getvedio(page):
    req=urllib2.Request('http://www.itingwa.com/listen/%s' %page)
    req.add_header("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3047.4 Safari/537.36")
    html = urllib2.urlopen(req).read()
    reg = r'jplayer" init-data="(.*?)"'
    rm = re.findall(reg,html)
    for i in rm:
       filename = i.split("/")[-1]
       print('正在下载%s' %filename)
       urllib.urlretrieve(i,"C:\Users\Administrator\Desktop\mp3/%s" %filename)#download
for i in range(90010,90018):
    getvedio(i)

